var t = require("../../utils/qinghuas.js"), n = null;

Page({
    data: {
        content: "内容获取中...",
        adInfo : null,
    },
    GetCon: function(t) {
        this.data.content = t.detail.value, console.log(t.detail.value);
    },
    CopySubmit: function() {
        wx.setClipboardData({
            data: this.data.content,
            success: function() {
                wx.showToast({
                    title: "复制成功",
                    duration: 1e3
                }), wx.getClipboardData({
                    success: function(t) {}
                });
            }
        });
    },
    OpenDream: function() {
        wx.navigateToMiniProgram({
            appId: "wx1d15304c3e4a7593",
            path: "pages/surgery/index/index",
            extraData: {
                foo: "bar"
            },
            envVersion: "develop",
            success: function(t) {}
        });
    },
    GetApi: function() {
        var n = this;
        t._get().then(function(t) {
            var a = t.nuannan, e = Math.floor(Math.random() * a.length);
            console.log(a[e]), n.setData({
                content: a[e]
            });
        }).catch(function(t) {});
    },
    ReplaceSubmit: function() {
        this.GetApi();
    },
    onLoad: function(t) {
        let cacheAdInfo = wx.getStorageSync('adInfo');  
        this.setData({
            adInfo: cacheAdInfo
        })
        this.GetApi(), wx.createInterstitialAd && (n = wx.createInterstitialAd({
            adUnitId: cacheAdInfo.interstitialid
        }));
    },
    onShow: function() {
        n && n.show().catch(function(t) {
            console.error(t);
        });
    },
    onShareAppMessage: function() {
        return {
            title: "最全撩妹情话",
            path: "pages/qinghua/qinghua?isshare=1",
            success: function(t) {},
            fail: function(t) {}
        };
    },
    onShareTimeline: function() {
        return {
            title: "最全撩妹情话",
            path: "pages/qinghua/qinghua?isshare=1",
            success: function(t) {},
            fail: function(t) {}
        };
    }
});